/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aptech.bluepumpkin;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Trong Nguyen
 */
@Entity
@Table(name = "CommentsList")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CommentsList.findAll", query = "SELECT c FROM CommentsList c"),
    @NamedQuery(name = "CommentsList.findById", query = "SELECT c FROM CommentsList c WHERE c.id = :id")})
public class CommentsList implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
   @GeneratedValue(strategy = GenerationType.IDENTITY) 
    @Column(name = "id")
    private Integer id;
    @JoinColumn(name = "event", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Event event;
    @JoinColumn(name = "comment", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Comment comment;

    public CommentsList() {
    }

    public CommentsList(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Event getEvent() {
        return event;
    }

    public void setEvent(Event event) {
        this.event = event;
    }

    public Comment getComment() {
        return comment;
    }

    public void setComment(Comment comment) {
        this.comment = comment;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CommentsList)) {
            return false;
        }
        CommentsList other = (CommentsList) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.aptech.bluepumpkin.CommentsList[ id=" + id + " ]";
    }
    
}
